﻿using System.Windows;

using EMan.Common.DependencyInjection;
using EMan.Common.EnterpriseStructure;
using EMan.Interface.EnterpriseStructure;

using EMan.Interface.EnterpriseStructure.Employees;

using TrueCode.Core.Aspects;

namespace EMan.GUI.EditStructure
{
  /// <summary>
  /// Interaction logic for EmployeeEditorView.xaml
  /// </summary>
  public partial class EmployeeEditorView : IEmployeeEditorView, IEmployeeEditorGuiElement
  {
    #region .ctors
    public EmployeeEditorView( [NotNull] IFactory factory, [NotNull] IEmployeeEditorPresenter presenter ) : base( factory, presenter )
    {
      InitializeComponent();
    }
    #endregion

    #region Entry points
    private void OnChooseJobButton_Click( object _, RoutedEventArgs __ )
    {
      Presenter.ChooseJob();
    }
    #endregion

    #region Implementation of IEmployeeEditorView
    public Job ShowJobChooserView()
    {
      var guiElement = Factory.Resolve< IJobChooserGuiElement >();
      ShowEditor( guiElement );
      return guiElement.ChoosedJob;
    }
    #endregion
  }
}
